<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>android事件分发机制 | 清风向阳</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
    <meta name="keywords" content="Joker,Joker's Blog" />
  
  <meta name="description" content="Android事件分发机制是我们学习Android必须要面临的问题，通常会涉及到事件冲突等问题，这也是对于新手来说比较复杂的学习过程。Android事件处理和Java类似，都是向上冒泡。一组事件序列包括down move move… up ,是以按下为开始，经历0或多个移动，最后以抬起结束。">
<meta name="keywords" content="Android,事件">
<meta property="og:type" content="article">
<meta property="og:title" content="android事件分发机制">
<meta property="og:url" content="http://mjjde.github.io/2016/01/15/android事件分发机制/index.html">
<meta property="og:site_name" content="清风向阳">
<meta property="og:description" content="Android事件分发机制是我们学习Android必须要面临的问题，通常会涉及到事件冲突等问题，这也是对于新手来说比较复杂的学习过程。Android事件处理和Java类似，都是向上冒泡。一组事件序列包括down move move… up ,是以按下为开始，经历0或多个移动，最后以抬起结束。">
<meta property="og:updated_time" content="2017-09-15T07:00:21.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="android事件分发机制">
<meta name="twitter:description" content="Android事件分发机制是我们学习Android必须要面临的问题，通常会涉及到事件冲突等问题，这也是对于新手来说比较复杂的学习过程。Android事件处理和Java类似，都是向上冒泡。一组事件序列包括down move move… up ,是以按下为开始，经历0或多个移动，最后以抬起结束。">
  
  
    <link rel="icon" href="/favicon_pic.ico">
  
  <link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css">
  <script src="/js/pace.min.js"></script>
  

  
  

</head>

<body>
  <div id="container">
      <header id="header">
    <div id="banner"></div>
    <div id="header-outer">
        <div id="header-menu" class="header-menu-pos animated">
            <div class="header-menu-container">
                <a href="/" class="left">
                    <span class="site-title">Joker&#39;s Blog</span>
                </a>
                <nav id="header-menu-nav" class="right">
                    
                    <a  href="/">
                        <i class="fa fa-home"></i>
                        <span>Home</span>
                    </a>
                    
                    <a  href="/archives">
                        <i class="fa fa-archive"></i>
                        <span>Archives</span>
                    </a>
                    
                    <a  href="/about">
                        <i class="fa fa-user"></i>
                        <span>About</span>
                    </a>
                    
                </nav>
                <a class="mobile-header-menu-button">
                    <i class="fa fa-bars"></i>
                </a>
            </div>
        </div>
        <div id="header-row">
            <div id="logo">
                <a href="/">
                    <img src="/images/avatar.jpg" alt="logo">
                </a>
            </div>
            <div class="header-info">
                <div id="header-title">
                    
                    <h2>
                        Joker&#39;s Blog
                    </h2>
                    
                </div>
                <div id="header-description">
                    
                    <h3>
                        一个认真的技术博客
                    </h3>
                    
                </div>
            </div>
            <nav class="header-nav">
                <div class="social">
                    
                        <a title="Joker"  href="//joker-studio.pub">
                            <i class="fa fa-home fa-2x"></i></a>
                    
                        <a title="Github" target="_blank" href="//github.com/mjjde">
                            <i class="fa fa-github fa-2x"></i></a>
                    
                </div>
            </nav>
        </div>
    </div>
</header>
      <div class="outer">
        <section id="main" class="body-wrap"><article id="post-android事件分发机制" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-inner">
    
      <header class="article-header">
        
  
    <h1 class="post-title" itemprop="name">
      android事件分发机制
    </h1>
    <div class="post-title-bar">
      <ul>
          
              <li>
                  <i class="fa fa-book"></i>
                  
                      <a href="/categories/Android技术/">Android技术</a>
                  
              </li>
          
        <li>
          <i class="fa fa-calendar"></i>  2016-01-15
        </li>
        <li>
          <i class="fa fa-eye"></i>
          <span id="busuanzi_value_page_pv"></span>
        </li>
      </ul>
    </div>
  

          
      </header>
    
    <div class="article-entry post-content" itemprop="articleBody">
      
            
            <blockquote>
<p>Android事件分发机制是我们学习Android必须要面临的问题，通常会涉及到事件冲突等问题，这也是对于新手来说比较复杂的学习过程。Android事件处理和Java类似，都是向上冒泡。一组事件序列包括down move move… up ,是以按下为开始，经历0或多个移动，最后以抬起结束。<br><a id="more"></a><br>在Android事件分发中共涉及到三个函数。</p>
</blockquote>
<figure class="highlight vbnet"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="built_in">boolean</span> dispatchTouchEvent(MotionEvent ev)处理事件的分发</div><div class="line"></div><div class="line"><span class="keyword">public</span> <span class="built_in">boolean</span> onInterceptTouchEvent(MotionEvent ev) 处理事件的拦截</div><div class="line"></div><div class="line"><span class="keyword">public</span> <span class="built_in">boolean</span> onTouchEvent(MotionEvent <span class="keyword">event</span>)处理事件的消费</div></pre></td></tr></table></figure>
<p>这三个函数都是有自己的职能，当我们点击到屏幕的开始，一个事件序列就开始产生，在序列产生的过程里我们最关心的其实是move，比如我们事件的冲突都是依靠move是的条件判断来解决。</p>
<p>我们可以通过一段伪代码来解释这三者的关系。</p>
<figure class="highlight aspectj"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="function"><span class="keyword">boolean</span> <span class="title">dispatchTouchEvent</span><span class="params">(MotionEvent ev)</span></span>&#123;</div><div class="line">    <span class="keyword">boolean</span> flag = <span class="keyword">false</span>;</div><div class="line">    <span class="keyword">if</span>(onInterceptTouchEvent(ev))&#123;</div><div class="line">        flag = onTouchEvent(ev)</div><div class="line">    &#125;<span class="keyword">else</span>&#123;</div><div class="line">        flag = child.dispatchTouchEvent(ev)</div><div class="line">    &#125;</div><div class="line">    <span class="keyword">return</span> flag;</div><div class="line"></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>针对于这段ViewGroup的事件，首先会调用dispatchTouchEvent方法，如果onInterceptTouchEvent返回为true的话，表示该ViewGroup对事件拦截，那么就会调用该ViewGroup的onTouchEvent方法，如果onInterceptTouchEvent返回false，那么表示该ViewGroup不去拦截事件，就会传递到下个子view去处理，dispatchTouchEvent返回的结果依赖于onInterceptTouchEvent和onTouchEvent以及child.dispatchTouchEvent(ev)。</p>
<p>我们来假设当前的ViewGroupon的InterceptTouchEvent返回false，那么就会去执行child.dispatchTouchEvent(ev)，如果所有的子View的dispatchTouchEvent都为false，那么该事件表示没有关心的子View去消费，最后事件会返回到Activity中的dispatchTouchEvent（），调用自己的OnTouch方法消费。如果后面的子View有去消费，那么该ViewGroup和该子View之间的所有View的dispatchTouchEvent都将放回true。我们可以看出在这种条件下dispatchTouchEvent的返回都是被动的，都是靠子View的返回来返回的。</p>
<p>事件的传递开始于Activity的dispatchTouchEvent方法，我们来看源码</p>
<figure class="highlight aspectj"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="function"><span class="keyword">boolean</span> <span class="title">dispatchTouchEvent</span><span class="params">(MotionEvent ev)</span> </span>&#123;</div><div class="line">    <span class="keyword">if</span> (ev.getAction() == MotionEvent.ACTION_DOWN) &#123;</div><div class="line">        onUserInteraction();</div><div class="line">    &#125;</div><div class="line">    <span class="keyword">if</span> (getWindow().superDispatchTouchEvent(ev)) &#123;</div><div class="line">        <span class="keyword">return</span> <span class="keyword">true</span>;</div><div class="line">    &#125;</div><div class="line">    <span class="function"><span class="keyword">return</span> <span class="title">onTouchEvent</span><span class="params">(ev)</span></span>;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h4 id="dispatchTouchEvent"><a href="#dispatchTouchEvent" class="headerlink" title="dispatchTouchEvent"></a><a href="#dispatchTouchEvent" title="dispatchTouchEvent"></a>dispatchTouchEvent</h4><p>我们看到第二个判断条件是调用了window的dispatchTouchEvent，window的唯一实现子类是PhoneWindow。</p>
<figure class="highlight aspectj"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"> <span class="keyword">public</span> <span class="function"><span class="keyword">boolean</span> <span class="title">superDispatchTouchEvent</span><span class="params">(MotionEvent event)</span> </span>&#123;</div><div class="line">    <span class="function"><span class="keyword">return</span> mDecor.<span class="title">superDispatchTouchEvent</span><span class="params">(event)</span></span>;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>这是PhoneWindow中的DispatchTouchEvent调用，mDecor是window的顶层ViewGroup,接着我们来看ViewGroup中得DispatchTouchEvent。</p>
<figure class="highlight lasso"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="built_in">boolean</span> dispatchTouchEvent(MotionEvent ev) &#123;</div><div class="line"></div><div class="line">        <span class="params">...</span><span class="params">...</span></div><div class="line"></div><div class="line">         <span class="keyword">if</span> (mFirstTouchTarget == <span class="built_in">null</span>) &#123;</div><div class="line">            <span class="comment">// No touch targets so treat this as an ordinary view.</span></div><div class="line">            handled = dispatchTransformedTouchEvent(ev, canceled, <span class="built_in">null</span>,</div><div class="line">                    TouchTarget.ALL_POINTER_IDS);</div><div class="line">        &#125;</div><div class="line"></div><div class="line">        <span class="params">...</span><span class="params">...</span></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>上面的代码我们先假设onInterceptTouchEvent默认的不去拦截，那么mFirstTouchTarget的值是什么呢，它代表的是如果有子类处理的事件，那么这个对象就指向那个子View,我们看到当当前的ViewGroup不去拦截，分发到下个View，这个view也不去分发，那么mFirstTouchTarget == null成立。就会去去执行dispatchTransformedTouchEvent方法，传过去的view是null。</p>
<figure class="highlight aspectj"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">private</span> <span class="function"><span class="keyword">boolean</span> <span class="title">dispatchTransformedTouchEvent</span><span class="params">(MotionEvent event, <span class="keyword">boolean</span> cancel,</span></span></div><div class="line">    View child, <span class="keyword">int</span> desiredPointerIdBits)&#123;</div><div class="line"></div><div class="line">    。。。。。</div><div class="line"></div><div class="line">     <span class="keyword">if</span> (child == <span class="keyword">null</span>) &#123;</div><div class="line">        handled = <span class="keyword">super</span>.dispatchTouchEvent(event);</div><div class="line">    &#125; <span class="keyword">else</span> &#123;</div><div class="line">        handled = child.dispatchTouchEvent(event);</div><div class="line">    &#125;</div><div class="line"></div><div class="line">    。。。。。</div><div class="line"></div><div class="line">    &#125;</div></pre></td></tr></table></figure>
<p>我们在源码里看到child为空得话就不会在去调用子view的dispatchTouchEvent方法，这意味着，如果在一串事件中，不去子view不去分发down事件，那么接下来的move和up都将不会去传递，那么如果子view分发down不分发其他事件，子view仍然会被执行dispatchTouchEvent，但是如果返回false，那么就会调用自己的onTouch方法消费事件，因为子为在分发的时候表达自己不去分发。</p>
<h4 id="onInterceptTouchEvent"><a href="#onInterceptTouchEvent" class="headerlink" title="onInterceptTouchEvent"></a><a href="#onInterceptTouchEvent" title="onInterceptTouchEvent"></a>onInterceptTouchEvent</h4><p>这个事件的处理依然在dispatchTouchEvent中：</p>
<figure class="highlight lasso"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div></pre></td><td class="code"><pre><div class="line">    <span class="params">...</span><span class="params">...</span></div><div class="line"></div><div class="line">     <span class="comment">// Handle an initial down.</span></div><div class="line">    <span class="keyword">if</span> (actionMasked == MotionEvent.ACTION_DOWN) &#123;</div><div class="line">        <span class="comment">// Throw away all previous state when starting a new touch gesture.</span></div><div class="line">        <span class="comment">// The framework may have dropped the up or cancel event for the previous gesture</span></div><div class="line">        <span class="comment">// due to an app switch, ANR, or some other state change.</span></div><div class="line">        cancelAndClearTouchTargets(ev);</div><div class="line">        resetTouchState();</div><div class="line">    &#125;</div><div class="line"></div><div class="line"><span class="comment">// Check for interception.        </span></div><div class="line">    final <span class="built_in">boolean</span> intercepted;</div><div class="line">    <span class="keyword">if</span> (actionMasked == MotionEvent.ACTION_DOWN</div><div class="line">            || mFirstTouchTarget != <span class="built_in">null</span>) &#123;</div><div class="line">        final <span class="built_in">boolean</span> disallowIntercept = (mGroupFlags &amp; FLAG_DISALLOW_INTERCEPT) != <span class="number">0</span>;</div><div class="line">        <span class="keyword">if</span> (!disallowIntercept) &#123;</div><div class="line">            intercepted = onInterceptTouchEvent(ev);</div><div class="line">            ev.setAction(action); <span class="comment">// restore action in case it was changed</span></div><div class="line">        &#125; <span class="keyword">else</span> &#123;</div><div class="line">            intercepted = <span class="literal">false</span>;</div><div class="line">        &#125;</div><div class="line">    &#125; <span class="keyword">else</span> &#123;</div><div class="line">        <span class="comment">// There are no touch targets and this action is not an initial down</span></div><div class="line">        <span class="comment">// so this view group continues to intercept touches.</span></div><div class="line">        intercepted = <span class="literal">true</span>;</div><div class="line">    &#125;</div><div class="line"></div><div class="line">    <span class="params">...</span><span class="params">...</span></div></pre></td></tr></table></figure>
<p>onInterceptTouchEvent的被处理和子View的dispatchTouchEvent处理有相似之处，我们看到有个 if (actionMasked == MotionEvent.ACTION_DOWN||mFirstTouchTarget != null)，首先我们要理解事件的DOWN肯定会走进来的，接下来FLAG_DISALLOW_INTERCEPT属性是个标志位，我们可以通过在子类中调用getparent（）.requestDisallowInterceptTouchEvent来改变它的值。用来阻止父控件对除DOWN事件的处理，为什么要出去Down呢，我们看到上面的代码，在执行Down的时候会重置这个标志位。</p>
<p>假设我们父控件的onInterceptTouchEvent直接拦截了Down方法，那么我们就可以看到之后的事件对于条件actionMasked == MotionEvent.ACTION_DOWN|| mFirstTouchTarget != null永远就不会成立，那么我们调整FLAG_DISALLOW_INTERCEPT也就没有任何作用，如果我们不拦截Down的话，我们的子View就可以控制FLAG_DISALLOW_INTERCEPT来进行对父控件的onInterceptTouchEvent的调用情况。这是一个解决事件冲突的一个手段。</p>
<h4 id="onTouchEvent"><a href="#onTouchEvent" class="headerlink" title="onTouchEvent"></a><a href="#onTouchEvent" title="onTouchEvent"></a>onTouchEvent</h4><p>我们重上面的伪代码中可以看到，一旦事件被拦截了就会调用onTouchEvent去消费事件，事件只能被消费一次，它的返回值会直接作用到dispatchTouchEvent的返回值的。OnTouchListener和OnTouchEvent之间的调用是由一定关系的，OnTouchListener是在OnTouchEvent之前被调用，如果OnTouchListener返回true消费事件的话，那么onTouchEvent就不会被调用，我们知道onClickLinstener是在onTouchEvent中被执行的，那么如果OnTouchListener消费事件的话，onClickLinstener就不会被触发。</p>

            <div class="post-copyright">
    <div class="content">
        <p>最后更新： 2017年09月15日 15:00</p>
        <p>原始链接： <a class="post-url" href="/2016/01/15/android事件分发机制/" title="android事件分发机制">http://mjjde.github.io/2016/01/15/android事件分发机制/</a></p>
        <footer>
            <a href="http://mjjde.github.io">
                <img src="/images/avatar.jpg" alt="Joker Mei">
                Joker Mei
            </a>
        </footer>
    </div>
</div>

      
    </div>
    <footer class="article-footer">
        
        
<div class="post-share">
    <a href="javascript:;" id="share-sub" class="post-share-fab">
        <i class="fa fa-share-alt"></i>
    </a>
    <div class="post-share-list" id="share-list">
        <ul class="share-icons">
          <li>
            <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://mjjde.github.io/2016/01/15/android事件分发机制/&title=《android事件分发机制》 — 清风向阳&pic=http://mjjde.github.ioimages/avatar.jpg" data-title="微博">
              <i class="fa fa-weibo"></i>
            </a>
          </li>
          <li>
            <a class="weixin share-sns" id="wxFab" href="javascript:;" data-title="微信">
              <i class="fa fa-weixin"></i>
            </a>
          </li>
          <li>
            <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://mjjde.github.io/2016/01/15/android事件分发机制/&title=《android事件分发机制》 — 清风向阳&source=
Android事件分发机制是我们学习Android必须要面临的问题，通常会涉及到事件冲突等问题，这也是对于新手来说比较复杂的学习过程。Android事件..." data-title="QQ">
              <i class="fa fa-qq"></i>
            </a>
          </li>
          <li>
            <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://mjjde.github.io/2016/01/15/android事件分发机制/" data-title="Facebook">
              <i class="fa fa-facebook"></i>
            </a>
          </li>
          <li>
            <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《android事件分发机制》 — 清风向阳&url=http://mjjde.github.io/2016/01/15/android事件分发机制/&via=http://mjjde.github.io" data-title="Twitter">
              <i class="fa fa-twitter"></i>
            </a>
          </li>
          <li>
            <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://mjjde.github.io/2016/01/15/android事件分发机制/" data-title="Google+">
              <i class="fa fa-google-plus"></i>
            </a>
          </li>
        </ul>
     </div>
</div>
<div class="post-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;" id="wxShare-close">×</a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=http://mjjde.github.io/2016/01/15/android事件分发机制/" alt="微信分享二维码">
</div>

<div class="mask"></div>

        
        <ul class="article-footer-menu">
            
            
  <li class="article-footer-tags">
    <i class="fa fa-tags"></i>
      
    <a href="/tags/Android/" class="color3">Android</a>
      
    <a href="/tags/事件/" class="color3">事件</a>
      
  </li>

        </ul>
        
    </footer>
  </div>
</article>


    <aside class="post-toc-pos post-toc-top" id="post-toc">
        <nav class="post-toc-wrap">
            <ol class="post-toc"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#dispatchTouchEvent"><span class="post-toc-text">dispatchTouchEvent</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#onInterceptTouchEvent"><span class="post-toc-text">onInterceptTouchEvent</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#onTouchEvent"><span class="post-toc-text">onTouchEvent</span></a></li></ol>
        </nav>
    </aside>
    

<nav id="article-nav">
  
    <a href="/2016/03/16/widget和Notification上的RemoteView/" id="article-nav-newer" class="article-nav-link-wrap">

      <span class="article-nav-title">
        <i class="fa fa-hand-o-left" aria-hidden="true"></i>
        
          widget和Notification上的RemoteView
        
      </span>
    </a>
  
  
    <a href="/2016/01/05/Android-IPC通讯Binder和Service的关系/" id="article-nav-older" class="article-nav-link-wrap">
      <span class="article-nav-title">Android-IPC通讯Binder和Service的关系</span>
      <i class="fa fa-hand-o-right" aria-hidden="true"></i>
    </a>
  
</nav>



    
</section>
        
      </div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info" class="inner">
      
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


      <p>
        Powered by  <a href="http://hexo.io/" target="_blank">Hexo</a>
        Theme <a href="//github.com/wongminho/hexo-theme-miho" target="_blank">MiHo</a>
      &copy; 2018 Joker Mei<br>
      </p>
    </div>
  </div>
</footer>
    <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script>
  var mihoConfig = {
      root: "http://mjjde.github.io",
      animate: false,
      isHome: false,
      share: true
  }
</script>
<div class="sidebar">
    <!-- <div id="sidebar-search" title="Search">
        <i class="fa fa-search"></i>
    </div> -->
    <div id="sidebar-category" title="Categories">
        <i class="fa fa-book"></i>
    </div>
    <div id="sidebar-tag" title="Tags">
        <i class="fa fa-tags"></i>
    </div>
    <div id="sidebar-top">
        <span class="sidebar-top-icon"><i class="fa fa-angle-up"></i></span>
    </div>
</div>
<div class="sidebar-menu-box" id="sidebar-menu-box">
    <div class="sidebar-menu-box-container">
        <div id="sidebar-menu-box-categories">
            <a class="category-link" href="/categories/Android技术/">Android技术</a><a class="category-link" href="/categories/其他技术/">其他技术</a><a class="category-link" href="/categories/网络技术/">网络技术</a><a class="category-link" href="/categories/设计模式/">设计模式</a>
        </div>
        <div id="sidebar-menu-box-tags">
            <a href="/tags/Activity/" style="font-size: 10px;">Activity</a> <a href="/tags/Android/" style="font-size: 16px;">Android</a> <a href="/tags/Android-IPC/" style="font-size: 10px;">Android-IPC</a> <a href="/tags/Binder/" style="font-size: 16px;">Binder</a> <a href="/tags/DiskLruCache/" style="font-size: 10px;">DiskLruCache</a> <a href="/tags/Fragment/" style="font-size: 10px;">Fragment</a> <a href="/tags/HTTP/" style="font-size: 20px;">HTTP</a> <a href="/tags/Java/" style="font-size: 10px;">Java</a> <a href="/tags/Notification/" style="font-size: 10px;">Notification</a> <a href="/tags/RemoteView/" style="font-size: 10px;">RemoteView</a> <a href="/tags/Rxjava/" style="font-size: 14px;">Rxjava</a> <a href="/tags/ServiceManager/" style="font-size: 14px;">ServiceManager</a> <a href="/tags/android/" style="font-size: 12px;">android</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/java/" style="font-size: 18px;">java</a> <a href="/tags/other/" style="font-size: 10px;">other</a> <a href="/tags/volley/" style="font-size: 12px;">volley</a> <a href="/tags/widget/" style="font-size: 10px;">widget</a> <a href="/tags/事件/" style="font-size: 10px;">事件</a> <a href="/tags/组件化/" style="font-size: 10px;">组件化</a> <a href="/tags/设计模式/" style="font-size: 18px;">设计模式</a>
        </div>
    </div>
    <a href="javascript:;" class="sidebar-menu-box-close">&times;</a>
</div>
<div class="mobile-header-menu-nav" id="mobile-header-menu-nav">
    <div id="mobile-header-menu-container">
        <span class="title">Menu</span>
        <ul class="mobile-header-menu-navbar">
            
            <li>
                <a  href="/">
                    <i class="fa fa-home"></i><span>Home</span>
                </a>
            </li>
            
            <li>
                <a  href="/archives">
                    <i class="fa fa-archive"></i><span>Archives</span>
                </a>
            </li>
            
            <li>
                <a  href="/about">
                    <i class="fa fa-user"></i><span>About</span>
                </a>
            </li>
            
        </ul>
    </div>
</div>
<div class="search-wrap">
    <span class="search-close">&times;</span>
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
            <i class="icon icon-lg icon-chevron-left"></i>
        </a>
        <input class="search-field" placeholder="Search..." id="keywords">
        <a id="search-submit" href="javascript:;">
            <i class="fa fa-search"></i>
        </a>
    <div class="search-container" id="search-container">
        <ul class="search-result" id="search-result">
        </ul>
    </div>
</div>

<div id="search-tpl">
    <li class="search-result-item">
        <a href="{url}" class="search-item-li">
            <span class="search-item-li-title" title="{title}">{title}</span>
        </a>
    </li>
</div>
<script src="/js/search.js"></script>
<script src="/js/main.js"></script>








  </div>
</body>
</html>